#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main(){
	double eps;
	scanf("%lf", &eps);
	int i = 1;
	double sign = 1.0;
	double sum = 0;

	do{
		sum = sum + sign / i;
		i += 3;
		sign = -sign;
	} while (1.0 / i >= eps);

	if (1.0 / (i - 3) != eps&&eps<1){
		sum = sum + sign / i;
	}
	printf("sum = %.6f", sum);
	return 0;
}
